package cn.ycl.system.api.syslog.feign;

import cn.ycl.system.api.syslog.domain.SysLog;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Service;

/**
 * @author yuanchangliang
 * @date 2022-06-21 09:30
 **/
@Service
public class RemoteSysLogServiceFallback implements FallbackFactory<RemoteSysLogService> {
    private static final Logger log = LoggerFactory.getLogger(RemoteSysLogServiceFallback.class);

    @Override
    public RemoteSysLogService create(Throwable cause) {
        log.info("调用日志接口失败：{}" + cause.getMessage());
        return new RemoteSysLogService() {
            @Override
            public SysLog insert(SysLog sysLog) {
                return null;

            }
        };
    }
}
